'use strict';
const db=uniCloud.database()
const dbCmd = db.command
exports.main = async (event, context) => {
	if(event.leixing==1){//为0时，添加新POS机
		const res=await db.collection('lipinka').add(event.shuju)
		// const res=await db.collection('lipinka').update({
		// 	next_duihuantime:""
		// })
		return res
	}else if(event.leixing==2){//为0时，添加新POS机
		const res=await db.collection('lipinka').update({
			leixing:"450型",
			creat_time:"2025-04-21 00:00:00",
			shengyu:12,
			shiyong:0,
			kazhuangtai:0,
			youxiaoqi:"2027-12-31 23:59:59"
		})
		return res
	}else if(event.leixing==3){//为0时，添加新POS机
		const res=await db.collection('uni-id-users').update({
			yu_e:0
		})
		return res
	}
};
